package com.tcs.test.single.singletions;

/**
 * 懒汉模式, 线程安全
 */
public class Singletion3 {

    private static Singletion3 singletion1 = null;

    private Singletion3() {
        System.out.println(" 懒汉模式,线程安全 ");
    }

    public static synchronized Singletion3 getSingletion1() {
        if (singletion1 == null) {
            singletion1 = new Singletion3();
        }
        return singletion1;
    }
}
